<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>leaflet1</title>
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css"
        integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI=" crossorigin="" />
    <link href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.4.1/MarkerCluster.Default.css">
    </link>
    <link rel="stylesheet" href="css/reveal.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw.css">
    <link rel="stylesheet" href="css/PolylineDecorator.css">
    <style>
        html,
        body {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
        }

        #map {
            width: 100%;
            height: 100%;
        }

        .leaflet-draw-section:nth-child(1) li a {
            display: none;
        }

        body {
            font-family: "HelveticaNeue", "Helvetica-Neue", "Helvetica", "Arial", sans-serif;
        }

        .contextMenu {
            list-style: none;
        }

        ul {
            list-style: none;
        }

        input {
            outline: none;
        }

        .text-label-r {
            font-size: 18px;
            color: red;
        }

        .polygonMenu,.circleMenu {
            background: rgba(43,44,47,.8);
            border: 1px solid #2b2c2f;
            padding: 12px 40px;
            filter: drop-shadow(0 0 10px rgb(173, 171, 171)) inset;
            border-radius: 2px;
            color: white;
        }
        .circleMenu:hover{
            background: rgb(83, 82, 82);
            color: rgb(175, 179, 182);
        }
        .polygonMenu:hover{
            background: rgb(83, 82, 82);
            color: rgb(175, 179, 182);
        }
    </style>
</head>

<body>
    <div id="map"></div>
    <!-- <div style="position: absolute;top: 20px;right: 150px;z-index: 999">
        <button id="btn" onclick="getarea(0)">北京市</button>
        <button id="btn" onclick="getarea(1)">昌平区</button>
        <button id="btn" onclick="getarea(2)">朝阳区</button>
        <button id="btn" onclick="getarea(3)">海淀区</button>
        <button id="btn" onclick="getarea(4)">怀柔区</button>
        <button id="btn" onclick="getarea(5)">密云区</button>
        <button id="btn" onclick="getarea(7)">延庆区</button>
        <button id="btn" onclick="getarea(8)">平谷区</button>
        <button id="btn" onclick="getarea(9)">石景山</button>
        <button id="btn" onclick="getarea(10)">东城</button>
        <button id="btn" onclick="getarea(11)">西城</button>
        <button id="btn" onclick="getarea(12)">门头沟</button>
        <button id="btn" onclick="getarea(13)">丰台区</button>
        <button id="btn" onclick="getarea(14)">房山区</button>
    </div> -->
    <div style="position: absolute;top: 100px;right: 50px;z-index: 999;">
        <div style="width: 250px;display: flex;justify-content: space-between;">
            <button onclick="draw('circle')">标记圆形</button>
            <button onclick="edit('circle')">编辑圆形</button>
            <button onclick="save('circle')">保存</button>
        </div>
        <div style="width: 250px;display: flex;justify-content: space-between;">
            <button onclick="draw('rectangle')">标记矩形</button>
            <button onclick="edit('rectangle')">编辑矩形</button>
            <button onclick="save('rectangle')">保存</button>
        </div>
        <div style="width: 250px;display: flex;justify-content: space-between;">
            <button onclick="draw('polygon')">标记多边形</button>
            <button onclick="edit('polygon')">编辑多边形</button>
            <button onclick="save('polygon')">保存</button>
        </div>
        <div style="width: 250px;display: flex;justify-content: space-between;">
            <button onclick="draw('polyLine')">编辑线</button>
            <!-- <button onclick="edit('polyLine')">edit线</button>
            <button onclick="save('polyLine')">save线</button> -->
        </div>
        <div>
            <button onclick="removeLayerAll()">全部清除</button>
        </div>
    </div>
    <ul class="circleContextMenu"
        style="position: absolute;bottom: 100px;right: 0;z-index: 999;cursor: pointer;display: none;">
        <li>
            <a class="big-link circleMenu" data-reveal-id="circleModal" data-animation="fade">
                修改经纬度、半径
            </a>
        </li>
    </ul>

    <div id="circleModal" class="reveal-modal"
        style="position: absolute;top: 50%;left:50%;transform: translateY(-50%);z-index: 999;text-align: center;">
        <div>
            <br>
            纬度：<input id="lat" type="number" step="0.1" style="outline: none;margin: 20px 0;height: 25px;">
            </br>
            经度：<input id="lng" type="number" step="0.1" style="outline: none;margin: 20px 0;height: 25px;">
            </br>
            半径：<input id="raduis" type="number" step="0.1" style="outline: none;margin: 20px 0;height: 25px;">
            <a class="close-reveal-modal" style="color:black;margin: 10px;">确定</a>
        </div>
    </div>



    <ul class="polygonContextMenu"
        style="position: absolute;bottom: 100px;right: 0;z-index: 999;cursor: pointer;display: none;">
        <li>
            <a class="big-link polygonMenu" data-reveal-id="polygonModal" data-animation="fade"
                >
                查看图层数据
            </a>
        </li>

    </ul>

    <div id="polygonModal" class="reveal-modal"
        style="position: absolute;top: 50%;left:50%;transform: translateY(-50%);z-index: 999;text-align: center;height: 230px;overflow: auto;">
        <ul style="display: flex;justify-content: space-around;font-weight: bold;margin-left: 70px;">
            <li>纬度</li>
            <li>经度</li>
        </ul>
        <div class="polygonLatlngs">
            <div style="display: flex;justify-content: space-around;margin-top: 15px;">
                <span class="pointNumber" style="width: 150px;display: inline-block;">点位1:</span>
                <input class="polygonLat" style="width: 230px;display: inline-block;margin-right: 10px;" />
                <input class="polygonLng" style="width: 230px;display: inline-block;margin-right: 10px;" />
            </div>
        </div>

        <a class="close-reveal-modal polygonSave" style="color:black;margin: 10px;">确定</a>
    </div>

    </div>
    </div>

    <script src="http://code.jquery.com/jquery-1.6.min.js"></script>
    <script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"></script>
    <script src="js/leaflet-providers.js"></script>
    <script src="js/leaflet-draw.js"></script>
    <script src="js/Leaflet.draw.cn.js"></script>
    <script src="js/jquery.reveal.js"></script>
    <script src="js/PolylineDecorator.js"></script>
    <script src="img/distanceMarker.png"></script>
    
    <script src="js/map.js"></script>
    <script>
        var defaults = {
            animation: 'fade', //可选模式为三种：fade, fadeAndPop, none
            animationspeed: 300, //动画效果速度
            closeonbackgroundclick: true, //设置点击模态化背景时是否关闭弹出层
            dismissmodalclass: 'close-reveal-modal' //设置关闭关闭的样式
        }; 
    </script>
</body>

</html>